package com.overseasShopping.Biz.impl;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.overseasShopping.Base.DAO.ChatDAO;
import com.overseasShopping.Biz.ChatBiz;
import com.overseasShopping.pojo.Chat;

public class ChatBizImpl implements ChatBiz{
	private ChatDAO chatDAO;
	
	
	public ChatDAO getChatDAO() {
		return chatDAO;
	}


	public void setChatDAO(ChatDAO chatDAO) {
		this.chatDAO = chatDAO;
	}


	public void addChat(String chatFrom, String chatTo,String content) {
			Chat chat=new Chat(0, chatFrom, chatTo, new Date(), content);
			chatDAO.save(chat);
	
	}


	public Chat getChat(String userId1,String userId2) {
		
		return chatDAO.getChat(userId1,userId2);
	}
	
}
